<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
	<xsl:output method="html" encoding="UTF-8"/>
	<xsl:include href="header.xsl"/>
	<xsl:include href="footer.xsl"/>
	<xsl:param name="display_path"/>
	<xsl:param name="exist-url"/>

	<xsl:param name="section"/>
	<xsl:template match="/">
		<html>
			<head>
				<title>
					<xsl:value-of select="/site_info/title"/>
					<xsl:text>: </xsl:text>
					<xsl:choose>
						<xsl:when test="string($section)">
							<xsl:value-of select="descendant::resources/child::node()[name() = $section]/@title"/>
						</xsl:when>
						<xsl:otherwise>Resources</xsl:otherwise>
					</xsl:choose>
				</title>
				<link rel="stylesheet" type="text/css"
					href="http://yui.yahooapis.com/2.8.2r1/build/grids/grids-min.css"/>
				<link rel="stylesheet" type="text/css"
					href="http://yui.yahooapis.com/2.8.2r1/build/reset-fonts-grids/reset-fonts-grids.css"/>
				<link rel="stylesheet" type="text/css"
					href="http://yui.yahooapis.com/2.8.2r1/build/base/base-min.css"/>
				<link rel="stylesheet" type="text/css"
					href="http://yui.yahooapis.com/2.8.2r1/build/fonts/fonts-min.css"/>
				<!-- Core + Skin CSS -->
				<link rel="stylesheet" type="text/css"
					href="http://yui.yahooapis.com/2.8.2r1/build/menu/assets/skins/sam/menu.css"/>
				
				<link type="text/css" href="style.css" rel="stylesheet"/>
			</head>
			<body class="yui-skin-sam">
				<div id="doc4">
					<xsl:call-template name="header"/>
					<div id="bd">
						<div id="yui-main">
							<xsl:choose>
								<xsl:when test="string($section)">
									<div class="resource_essay">
										<a href="resources">«Back to Resources</a>
										<xsl:copy-of
											select="descendant::resources/child::node()[name() = $section]/*"
										/>
										<a href="resources">«Back to Resources</a>
									</div>
								</xsl:when>
								<xsl:otherwise>
									<h2>Resources</h2>
									<p>Select an essay below:</p>
									<ul>
										<xsl:for-each select="descendant::resources/child::node()">
											<xsl:sort select="@title"/>
											<li>
												<a href="?section={name()}">
													<xsl:value-of select="@title"/>
												</a>
											</li>
										</xsl:for-each>
									</ul>
								</xsl:otherwise>
							</xsl:choose>
						</div>						
					</div>
					<xsl:call-template name="footer"/>
				</div>
				<script type="text/javascript">
					var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
					document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
				</script>
				<script type="text/javascript">
					try {
					var pageTracker = _gat._getTracker("UA-5343246-4");
					pageTracker._trackPageview();
					} catch(err) {}</script>		
			</body>			
		</html>
	</xsl:template>
</xsl:stylesheet>
